Right way to create [self]respawning app in python

Posted by grapescan on Stack Overflow See other posts from Stack Overflow or by grapescan
Published on 2010-03-31T19:26:08Z Indexed on 2010/03/31 20:13 UTC
Read the original article Hit count: 358

Filed under:
|
|
|

I am using jabber bot written in python to log some MUC talks. Sometimes it drops on some network or XMPP problems. In this case I have to start it again by myself. The goal is to make it "self-respawning".

I have some variants about how to do it.

  1. Bot is one process. Another process monitors its activity and starts it if bot died.
  2. Main process spawns bot subprocess and controls it.

Also I think daemonizing bot process is useful here. Platform is Linux, as you could guess.

What is the right way to solve this problem?

© Stack Overflow or respective owner

Related posts about python

Related posts about spawn